<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>离职申请</title>
</head>
<body>
	<script type="text/javascript">
		$(function() {
			$('#quit_form').form('load','get_quit');
			$("#quit_save").linkbutton({
				onClick : function() {
					$("#quit_form").form({
						url : "save_quit",
						success : function(data) {
							if (data=='true') {
								$("#quit_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
							}
							$.messager.alert("消息",data=='true'?"保存成功！":"保存失败");
						}
					});
					var submit = $("#quit_form").form('enableValidation').form('validate');
					if (submit) {
						$.messager.confirm('消息', '您确定上传该流程吗？上传后无法修改！', function(r){
							if (r) {
								$("#quit_form").submit();
							}
						})
					}
				}
			});
			$("#quit_submit").linkbutton({
				onClick : function() {
					$("#quit_form").form({
						url : "submit_quit",
						onSubmit : function(params) {
							params.pk = 'quit_act';
						},
						success : function(data) {
							if (data=='true') {
								$("#quit_form").form("clear");
								//获取选中的面板
								var tab = $('#tt').tabs('getSelected');
								//根据选中的面板获取该面板的索引
								var index = $('#tt').tabs('getTabIndex',tab);
								//根据索引关闭
								if(index != 0){
									$('#tt').tabs('close',index);
								}
							}
							$.messager.alert("消息",data=='true'?"提交成功！":"提交失败");
						}
					});
					var submit = $("#quit_form").form('enableValidation').form('validate');
					if (submit) {
						$.messager.confirm('消息', '您确定上传该流程吗？上传后无法修改！', function(r){
							if (r) {
								$("#quit_form").submit();
							}
						})
					}
				}
			});
		})
	
	</script>
	<div class="easyui-layout" fit="true">
		<div data-options="region:'center'" align="center" style="border: none;">
			<form id="quit_form" method="post">
				<table class="table" style="margin:10px; width: 70%" border="0" cellpadding="0" cellspacing="0">
				<thead>
					<tr align="center">
						<th colspan="5" style="font-size: 17px">离职申请单</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>
							<!-- emp_name 姓名 -->
							<input name="empName" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="申请人：" editable="false">
							<!-- quit_uptime 申请日期 -->
							<input name="quitUptime" id="ss" class="easyui-datebox" labelAlign="right"
								style="width: 30%;" label="申请日期：" readonly="readonly"></input>
							<!-- dept_name 部门名称 -->
							<input name="deptName" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="部门：" editable="false">
							<!-- 隐藏的部门和员工id -->
							<input name="deptId" type="hidden">
							<input name="empId"  type="hidden">
						</td>
					</tr>
					<tr>
						<td>
							<!-- position_name 职位名称 -->
							<input name="positionName" class="easyui-textbox" labelAlign="right"
								style="width: 30%;" label="职位：" editable="false">
							<!-- quit_time 离职具体时间 -->
							<input name="quitTime" label="离职具体时间：" class="easyui-datebox" required
								style="width:30%;"  editable="false" labelWidth="101%"  labelAlign="right">
							<select name="quitType" class="easyui-combobox" style="width: 30%;"  
									label="离职类型：" labelAlign='right' editable="false" required>
								<option value="retire">退休</option>
								<option value="illness">病退</option>
								<option value="dismiss">辞退</option>
								<option value="resign">辞职</option>
							</select>
							<!-- 隐藏的职位id -->
							<input name="positionId"  type="hidden">
							
						</td>
					</tr>
					<tr>
						<td>
							<!-- quit_explain 离职申请说明 -->
							<input name="quitExplain" class="easyui-textbox" style="width:80%;height:100px;" label="离职申请说明："
								multiline="true" labelWidth="120%" required  labelAlign="right">
							<input name="lunchPeople"  type="hidden">
						</td>
					</tr>
					<tr>
						<td style="text-align: center">
							<a id="quit_save" class="easyui-linkbutton"
								data-options="iconCls:'icon-save',text:'暂存'"></a>
							<a id="quit_submit" class="easyui-linkbutton"
								data-options="iconCls:'icon-submit',text:'提交'"></a>
						</td>
					</tr>
				</tbody>
				</table>
			</form>
		</div>
	</div>
</body>
</html>